1. Field of the Invention
The present invention relates to a music replay circuit which decodes music data which is compressed by a predetermined encoding method and replays the decoded music data.
2. Description of the Related Art
Recently, music replay devices are widely in use which replay music data which is compressed by an encoding method such as MP3 or AAC. The compressed music data as described above realizes compression of data by reducing an amount of data for a high-frequency portion for which the sensitivity of the hearing of humans is low, and applying a discrete cosine transform process to the data having the amount of data reduced. Because a sufficient amount of music data can be stored in a memory having a low capacity by compressing the music data, such a technique allows creation of a music replay device having a reduced cost and a reduced size.
As described, because data of the high-frequency portion is removed in the compressed music data, the sound quality is reduced compared to the music data before compression. FIG. 4A shows a frequency characteristic of the compressed music data. Music data which is sampled at a frequency of 44.1 kHz is data which includes frequency components with the upper limit at 22 kHz. However, because the data of the high-frequency portion is removed in the compressed music data, the data is, in the example configuration of FIG. 4A, data including frequency components with the upper limit at approximately 13 kHz. As a technique for interpolating the data of the removed high-frequency portion when the compressed music data is replayed, there is known an invention described in Japanese Patent No. 3820331.
Japanese Patent No. 3820331 discloses in FIG. 1 a music data signal decoding system comprising a sampler 3, an upsampler 5, and a digital filter 6. For the music data to be replayed, the sampler 3 applies a downsampling process, and then, the upsampler 5 applies an upsampling process. In other words, the upsampler 5 inserts a zero signal to the data portion removed by the sampler 3. The digital filter 6 applies a filter process to the music data in which the zero signal is inserted at a predetermined period, so that the inserted zero signal is corrected to a suitable value and music data in which the data of the high-frequency portion is interpolated and leveled is generated.
FIG. 8 is a block diagram of a music replay circuit 100 of related art having a function to interpolate the data of the high-frequency portion. The music replay circuit 100 comprises a CPU 120, an interface (I/F) unit 122, a decoder 130, and a high-frequency correction unit 140, and is connected to a memory 200 in which the compressed music data is stored.
The CPU 120 is connected to various signal processors included in the music replay circuit 100 through a bus, and controls operations of various signal processors such as the I/F unit 122, decoder 130, and high-frequency correction unit 140. The CPU 120 controls operations of various signal processors according to a control program stored in the memory 200 or another memory which is not shown.
The I/F unit 122 reads music data stored in the memory 200 and transfers the music data to the decoder 130. The I/F unit 122 also executes reading and writing processes of various data including the music data between the music replay circuit 100 and the memory 200, according to an instruction by the CPU 120.
The decoder 130 applies a decoding process to the compressed music data which is read from the memory 200, and generates music data. The decoder 130 applies a decoding process according to an encoding method such as MP3 and AAC.
The high-frequency correction unit 140 is a circuit which applies an interpolation process of the data of the high-frequency portion on the decoded music data, and corresponds to the signal decoding system described in Japanese Patent No. 3820331. The high-frequency correction unit 140 applies a downsampling process, an upsampling process, and a filter process on the decoded music data, to generate music data in which the high-frequency portion is interpolated. The high-frequency correction unit 140 comprises a register 142 which stores a filter coefficient for executing the filter process, and a filter coefficient is stored by a control of the CPU 120.
The music data stored in the memory 200 includes a data stream having a plurality of frames. Each frame of the data stream has a header portion provided at the front portion of the frame and a user data portion following the header portion. For example, when music data which is sampled at the frequency of 44.1 kHz is compressed by the encoding method of MP3, a compression process is executed with data of 1152 consecutive samples as one frame. When the compression rate is constant, that is, for the case of the compressed music data of a fixed bit rate, all frames in the data stream have the same bit number, and information indicating a constant data length is attached in the header to be attached to each frame.
The CPU 120 determines a coefficient of the filter included in the high-frequency correction unit 140 based on the information of the bit rate, and sets the filter coefficient in the register 142. In the case of the fixed bit rate, the high-frequency correction unit 140 executes the high-frequency correction process using the same filter coefficient.
Although compressed music data has an advantage that the data capacity is low, because the music data of the high-frequency portion is removed, the compressed music data always suffers a problem of degradation in sound quality. As a method for improving this, there is known an encoding process of a variable bit rate method in which the compression rate is changed for each frame in the data stream. In other words, according to a characteristic of each frame, a bit rate which can achieve a high sound quality and a high compression rate is selected, and the encoding process is executed.
When compressed music data of a variable bit rate is to be replayed with the music replay circuit 100 of related art, the high-frequency correction unit 140 applies the high-frequency correction process using the same filter coefficient to the frames having different compression rates. In this process, in the replayed music, the optimum correction process may not be performed even though the high-frequency correction process is applied.
As the bit rate of the frame is reduced, the amount of music data of the high-frequency portion to be removed is increased. Therefore, the optimum filter coefficient used in the high-frequency correction process differs according to the bit rate of each frame. More specifically, when the high-frequency correction process is applied using a certain constant filter coefficient when the compressed music data of a variable bit rate is to be replayed, the filter coefficient may be an optimum filter coefficient for a frame having a high bit rate, but not an optimum filter coefficient for a frame having a low bit rate. In this case, although the high-frequency correction process is applied, an optimum high-frequency correction process is not applied to the frames having low bit rates, and the performance of sound quality improvement by the high-frequency correction process cannot be sufficiently realized.